#!/bin/bash

# 测试 S3 对象存储配置
echo "🧪 测试 S3 对象存储配置..."

# 检查环境变量
echo "📋 检查环境变量:"
echo "S3_ACCESS_KEY: ${S3_ACCESS_KEY:-未设置}"
echo "S3_SECRET_KEY: ${S3_SECRET_KEY:-未设置}"
echo "S3_BUCKET: ${S3_BUCKET:-未设置}"
echo "S3_ENDPOINT: ${S3_ENDPOINT:-未设置}"
echo ""

# 测试 API 端点
echo "🌐 测试 API 端点:"
echo "健康检查:"
curl -s http://localhost:3001/health | jq . || echo "健康检查失败"

echo ""
echo "测试相册 API:"
curl -s -X POST http://localhost:3001/api/v1/albums/68f1b72e3cf9b4255725e3ff/photos \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F "file=@/dev/null" \
  -F "title=test" || echo "相册 API 测试失败"

echo ""
echo "✅ S3 配置测试完成"
